package hhm.javamode.proxy.log;

import hhm.javamode.base.adduser.IUserService;
import hhm.javamode.base.adduser.UserServiceImpl;

/**
 * 
 * @author huanghaoming
 *
 */
public class UserServiceProxy implements IUserService {
	private UserServiceImpl userServiceImpl;

	public UserServiceProxy(UserServiceImpl userServiceImpl) {
		this.userServiceImpl = userServiceImpl;
	}

	@Override
	public void addUser(String userId, String userName) {
		// 在这里写个日志,或者把日志写入到数据库，随你便，类似于spring的aop
		System.out.println("日志:" + "有一个用户注册了:" + userId + "__" + userName);
		// 写好日志后，再做操作
		userServiceImpl.addUser(userId, userName);

	}

}
